//package com.hqshuke.exchange.trade.handler;
//
//import com.google.protobuf.Int64Value;
//import com.hqshuke.exchange.trade.grpc.my.MyRequest;
//import com.hqshuke.exchange.trade.grpc.my.MyResponse;
//import com.hqshuke.exchange.trade.grpc.my.MyServiceProviderGrpc;
//import com.hqshuke.grpc.blockchain.message.QueryStockOptRecordsRequest;
//import com.hqshuke.grpc.blockchain.service.MessageType;
//import com.hqshuke.grpc.blockchain.service.RequestMessage;
//import com.hqshuke.grpc.blockchain.service.ResponseMessage;
//import com.hqshuke.grpc.erp.scenic.GetCoInfoResponse;
//import com.hqshuke.grpcClient.BlockChainClient;
//import com.hqshuke.grpcClient.ErpClient;
//import io.grpc.stub.StreamObserver;
//import lombok.extern.slf4j.Slf4j;
//import net.devh.boot.grpc.server.service.GrpcService;
//
//import javax.annotation.Resource;
//import java.time.LocalDateTime;
//
//@GrpcService
//@Slf4j
//public class MyHandler extends MyServiceProviderGrpc.MyServiceProviderImplBase {
//
//    @Resource
//    private ErpClient erpClient;
//
//    @Resource
//    private BlockChainClient blockChainClient;
//
//    @Override
//    public void info(MyRequest request, StreamObserver<MyResponse> responseObserver){
//
//        // 区跨链
//        QueryStockOptRecordsRequest.Builder builder = QueryStockOptRecordsRequest.newBuilder().setAccount("0xsk8847a497cda6fd0ba03ca734ccb2e8ee9c0522").setOrg("yilvtong").setStockBatchNumber("1");
//        RequestMessage.Builder requestMessage = RequestMessage.newBuilder();
//        requestMessage.setRequestId("TRACE_ID").setReferenceDate(LocalDateTime.now().toString()).setMessageType(MessageType.QUERY_STOCK_OPT_RECORDS);
//        requestMessage.setQueryStockOptRecords(builder);
//        //获取库存操作记录
//        ResponseMessage message = blockChainClient.mainBlockChainStub.mainOrderTicket(requestMessage.build());
//
//        // 获取景区企业信息
//        GetCoInfoResponse scenicCoInfo = erpClient.scenicStub.getCoInfo(Int64Value.of(request.getId()));
//        MyResponse.Builder myBuilder = MyResponse.newBuilder();
//        myBuilder.setId(request.getId());
//        myBuilder.setName("嘻嘻");
//        responseObserver.onNext(myBuilder.build());
//        responseObserver.onCompleted();
//    }
//}
